# Maintainer: Paul Moore <p.f.moore@gmail.com>

_realname=file
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=5.25
pkgrel=1
pkgdesc='Determine the type of a file from its contents (mingw-w64)'
arch=('any')
url='http://www.darwinsys.com/file/'
license=('BSD')
depends=("${MINGW_PACKAGE_PREFIX}-libsystre")
source=(#ftp://ftp.astron.com/pub/${_realname}/${_realname}-${pkgver}.tar.gz
        https://fossies.org/linux/misc/${_realname}-${pkgver}.tar.gz)
sha256sums=('3735381563f69fb4239470b8c51b876a80425348b8285a7cded8b61d6b890eca')
options=('strip' '!libtool' 'staticlibs')

prepare() {
  cd $srcdir/${_realname}-${pkgver}
}

build() {
  cd $srcdir/${_realname}-${pkgver}
  ./configure --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST}

  make
}

package() {
  cd ${srcdir}/${_realname}-${pkgver}
  make install DESTDIR="${pkgdir}"

  # Licenses
  install -Dm644 "${srcdir}/${_realname}-${pkgver}/README" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/README"
  install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
}
